home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / listx / putitems.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-11-12  |  9.4 KB  |  272 lines

  1. VERSION 5.00
  2. Object = "{9FE255D1-F32E-11D0-9E15-444553540000}#1.0#0"; "MLISTX.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "List/X+ PutItems Sample"
  5.    ClientHeight    =   3315
  6.    ClientLeft      =   1755
  7.    ClientTop       =   2145
  8.    ClientWidth     =   7035
  9.    LinkTopic       =   "Form1"
  10.    PaletteMode     =   1  'UseZOrder
  11.    ScaleHeight     =   3315
  12.    ScaleWidth      =   7035
  13.    Begin MabryCtl.MList MList1 
  14.       Height          =   2265
  15.       Index           =   3
  16.       Left            =   5280
  17.       TabIndex        =   3
  18.       Top             =   240
  19.       Width           =   1575
  20.       _ExtentX        =   2778
  21.       _ExtentY        =   3995
  22.       Object.TabStop         =   -1  'True
  23.       MousePointer    =   -842150451
  24.       ColRowOrder     =   0   'False
  25.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  26.          Name            =   "MS Sans Serif"
  27.          Size            =   8.25
  28.          Charset         =   0
  29.          Weight          =   400
  30.          Underline       =   0   'False
  31.          Italic          =   0   'False
  32.          Strikethrough   =   0   'False
  33.       EndProperty
  34.       BeginProperty Columns {23BAA6DE-05A6-11D1-9E15-0020AFD6A9D5} 
  35.          ColumnCount     =   2
  36.          BeginProperty Column0 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  37.             Object.Width           =   50
  38.             MinWidth        =   0
  39.             MaxWidth        =   -1
  40.             UserResizeEnabled=   -1
  41.             Heading         =   "Col 1"
  42.             Object.Visible         =   -1
  43.             ColumnAlignment =   0
  44.             HeadingAlignment=   0
  45.          EndProperty
  46.          BeginProperty Column1 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  47.             Object.Width           =   25
  48.             MinWidth        =   0
  49.             MaxWidth        =   -1
  50.             UserResizeEnabled=   -1
  51.             Heading         =   "Col 2"
  52.             Object.Visible         =   -1
  53.             ColumnAlignment =   0
  54.             HeadingAlignment=   0
  55.          EndProperty
  56.       EndProperty
  57.    End
  58.    Begin MabryCtl.MList MList1 
  59.       Height          =   2265
  60.       Index           =   2
  61.       Left            =   3600
  62.       TabIndex        =   2
  63.       Top             =   240
  64.       Width           =   1575
  65.       _ExtentX        =   2778
  66.       _ExtentY        =   3995
  67.       Object.TabStop         =   -1  'True
  68.       MousePointer    =   -842150451
  69.       ColRowOrder     =   0   'False
  70.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  71.          Name            =   "MS Sans Serif"
  72.          Size            =   8.25
  73.          Charset         =   0
  74.          Weight          =   400
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       BeginProperty Columns {23BAA6DE-05A6-11D1-9E15-0020AFD6A9D5} 
  80.          ColumnCount     =   2
  81.          BeginProperty Column0 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  82.             Object.Width           =   50
  83.             MinWidth        =   0
  84.             MaxWidth        =   -1
  85.             UserResizeEnabled=   -1
  86.             Heading         =   "Col 1"
  87.             Object.Visible         =   -1
  88.             ColumnAlignment =   0
  89.             HeadingAlignment=   0
  90.          EndProperty
  91.          BeginProperty Column1 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  92.             Object.Width           =   25
  93.             MinWidth        =   0
  94.             MaxWidth        =   -1
  95.             UserResizeEnabled=   -1
  96.             Heading         =   "Col 2"
  97.             Object.Visible         =   -1
  98.             ColumnAlignment =   0
  99.             HeadingAlignment=   0
  100.          EndProperty
  101.       EndProperty
  102.    End
  103.    Begin MabryCtl.MList MList1 
  104.       Height          =   2265
  105.       Index           =   1
  106.       Left            =   1920
  107.       TabIndex        =   1
  108.       Top             =   240
  109.       Width           =   1575
  110.       _ExtentX        =   2778
  111.       _ExtentY        =   3995
  112.       Object.TabStop         =   -1  'True
  113.       MousePointer    =   -842150451
  114.       ColRowOrder     =   0   'False
  115.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  116.          Name            =   "MS Sans Serif"
  117.          Size            =   8.25
  118.          Charset         =   0
  119.          Weight          =   400
  120.          Underline       =   0   'False
  121.          Italic          =   0   'False
  122.          Strikethrough   =   0   'False
  123.       EndProperty
  124.       BeginProperty Columns {23BAA6DE-05A6-11D1-9E15-0020AFD6A9D5} 
  125.          ColumnCount     =   2
  126.          BeginProperty Column0 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  127.             Object.Width           =   50
  128.             MinWidth        =   0
  129.             MaxWidth        =   -1
  130.             UserResizeEnabled=   -1
  131.             Heading         =   "Col 1"
  132.             Object.Visible         =   -1
  133.             ColumnAlignment =   0
  134.             HeadingAlignment=   0
  135.          EndProperty
  136.          BeginProperty Column1 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  137.             Object.Width           =   25
  138.             MinWidth        =   0
  139.             MaxWidth        =   -1
  140.             UserResizeEnabled=   -1
  141.             Heading         =   "Col 2"
  142.             Object.Visible         =   -1
  143.             ColumnAlignment =   0
  144.             HeadingAlignment=   0
  145.          EndProperty
  146.       EndProperty
  147.    End
  148.    Begin MabryCtl.MList MList1 
  149.       Height          =   2265
  150.       Index           =   0
  151.       Left            =   240
  152.       TabIndex        =   0
  153.       Top             =   240
  154.       Width           =   1575
  155.       _ExtentX        =   2778
  156.       _ExtentY        =   3995
  157.       Object.TabStop         =   -1  'True
  158.       MousePointer    =   -842150451
  159.       ColRowOrder     =   0   'False
  160.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  161.          Name            =   "MS Sans Serif"
  162.          Size            =   8.25
  163.          Charset         =   0
  164.          Weight          =   400
  165.          Underline       =   0   'False
  166.          Italic          =   0   'False
  167.          Strikethrough   =   0   'False
  168.       EndProperty
  169.       BeginProperty Columns {23BAA6DE-05A6-11D1-9E15-0020AFD6A9D5} 
  170.          ColumnCount     =   2
  171.          BeginProperty Column0 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  172.             Object.Width           =   50
  173.             MinWidth        =   0
  174.             MaxWidth        =   -1
  175.             UserResizeEnabled=   -1
  176.             Heading         =   "Col 1"
  177.             Object.Visible         =   -1
  178.             ColumnAlignment =   0
  179.             HeadingAlignment=   0
  180.          EndProperty
  181.          BeginProperty Column1 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  182.             Object.Width           =   25
  183.             MinWidth        =   0
  184.             MaxWidth        =   -1
  185.             UserResizeEnabled=   -1
  186.             Heading         =   "Col 2"
  187.             Object.Visible         =   -1
  188.             ColumnAlignment =   0
  189.             HeadingAlignment=   0
  190.          EndProperty
  191.       EndProperty
  192.    End
  193.    Begin VB.Label Label1 
  194.       Alignment       =   2  'Center
  195.       Caption         =   "This sample shows how to use the PutItems method to quickly load List/X+ controls with large amounts of data."
  196.       BeginProperty Font 
  197.          Name            =   "MS Sans Serif"
  198.          Size            =   9.75
  199.          Charset         =   0
  200.          Weight          =   400
  201.          Underline       =   0   'False
  202.          Italic          =   0   'False
  203.          Strikethrough   =   0   'False
  204.       EndProperty
  205.       Height          =   495
  206.       Left            =   240
  207.       TabIndex        =   4
  208.       Top             =   2640
  209.       Width           =   6615
  210.    End
  211. Attribute VB_Name = "Form1"
  212. Attribute VB_GlobalNameSpace = False
  213. Attribute VB_Creatable = False
  214. Attribute VB_PredeclaredId = True
  215. Attribute VB_Exposed = False
  216. Option Explicit
  217. Private Sub Form_Load()
  218.    Dim str1d(1000) As String
  219.    Dim str2d(1000, 1) As String
  220.    Dim var2d(1000, 1) As Variant
  221.    Dim rev2d(1, 1000) As Variant
  222.    Dim r, c As Integer
  223.    ' Load 1d string array
  224.    For r = LBound(str1d) To UBound(str1d)
  225.          str1d(r) = "Row " & r & MList1(0).ColDelimiter & "Col 2"
  226.    Next
  227.    ' Load 2d string array
  228.    For r = LBound(str2d, 1) To UBound(str2d, 1)
  229.       For c = LBound(str2d, 2) To UBound(str2d, 2)
  230.          If (c = 0) Then
  231.             str2d(r, c) = "Row " & r
  232.          Else
  233.             str2d(r, c) = "Col " & c + 1
  234.          End If
  235.       Next
  236.    Next
  237.    ' Load 2d variant array
  238.    For r = LBound(var2d, 1) To UBound(var2d, 1)
  239.       For c = LBound(var2d, 2) To UBound(var2d, 2)
  240.          If (c = 0) Then
  241.             var2d(r, c) = "Row " & r
  242.          Else
  243.             var2d(r, c) = "Col " & c + 1
  244.          End If
  245.       Next
  246.    Next
  247.    ' Load 2d variant array ordered (col, row)
  248.    For c = LBound(rev2d, 1) To UBound(rev2d, 1)
  249.       For r = LBound(rev2d, 2) To UBound(rev2d, 2)
  250.          If (c = 0) Then
  251.             rev2d(c, r) = "Row " & r
  252.          Else
  253.             rev2d(c, r) = "Col " & c + 1
  254.          End If
  255.       Next
  256.    Next
  257.    ' show form
  258.    Me.Left = (Screen.Width - Me.ScaleWidth) / 2
  259.    Me.Top = (Screen.Height - Me.ScaleHeight) * 2 / 5
  260.    Me.Show
  261.    DoEvents
  262.    ' stuff em
  263.    MList1(0).PutItems str1d
  264.    DoEvents
  265.    MList1(1).PutItems str2d
  266.    DoEvents
  267.    MList1(2).PutItems var2d
  268.    DoEvents
  269.    MList1(3).ColRowOrder = True
  270.    MList1(3).PutItems rev2d
  271. End Sub
  272.